<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        html {
            height: 100%
        }

        body {
            height: 100%;
            margin: 0px;
            padding: 0px
        }

        #container {
            height: 100%
        }
    </style>
    <script type="text/javascript"
        src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=SuAbrtK1Bu5V9XISRleW91vpdEVQ70IZ"></script>
</head>

<body>
    <div id="container"></div>
    <script>
        // 创建地图实例
        var map = new BMapGL.Map("container");
        // 设置地图中心点，这里是天安门   34.80452,113.680779
        var point = new BMapGL.Point(113.680779, 34.80452);
        map.centerAndZoom(point, 15);

        // 通过js获取当前位置
        // navigator.geolocation.getCurrentPosition(function (p) {
        //     console.log(p)
        // })
    </script>
</body>

</html>